.class public Lcom/glympse/platform/common/Message;
.super Ljava/lang/Object;
.source "Message.java"


# instance fields
.field public m_strMessage:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 20
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    .line 25
    return-void
.end method

.method public constructor <init>(Lcom/glympse/platform/common/Message;)V
    .locals 1
    .parameter "oMessage"

    .prologue
    .line 34
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 20
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    .line 36
    iget-object v0, p1, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    iput-object v0, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    .line 37
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "strText"

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 20
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    .line 30
    iput-object p1, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    .line 31
    return-void
.end method


# virtual methods
.method public Parse(Lcom/glympse/platform/GVector$NameValueNodes;)V
    .locals 4
    .parameter

    .prologue
    .line 43
    .local p1, listNameValues:Lcom/glympse/platform/GVector$NameValueNodes;,"Lcom/glympse/platform/GVector$NameValueNodes;"
    invoke-virtual {p1}, Lcom/glympse/platform/GVector$NameValueNodes;->elements()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, iter:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v2

    if-nez v2, :cond_1

    .line 66
    return-void

    .line 45
    :cond_1
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/platform/common/NameValueNode;

    .line 48
    .local v1, oNodeCur:Lcom/glympse/platform/common/NameValueNode;
    iget-object v2, v1, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_0

    iget-object v2, v1, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    if-eqz v2, :cond_0

    .line 54
    iget-object v2, v1, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    const-string v3, "msg"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 56
    iget-object v2, v1, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    iput-object v2, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    .line 57
    iget-object v2, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;

    goto :goto_0

    .line 63
    :cond_2
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Unknown Message value: \""

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, v1, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, v1, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\""

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public Serialize(Ljava/lang/StringBuffer;)V
    .locals 2
    .parameter "strbuf"

    .prologue
    .line 71
    invoke-virtual {p1}, Ljava/lang/StringBuffer;->length()I

    move-result v1

    if-lez v1, :cond_2

    const/4 v1, 0x1

    move v0, v1

    .line 74
    .local v0, fAppend:Z
    :goto_0
    iget-object v1, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 76
    if-eqz v0, :cond_0

    const/16 v1, 0x2c

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    :cond_0
    const/4 v0, 0x1

    .line 77
    const-string v1, "msg:\""

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 78
    iget-object v1, p0, Lcom/glympse/platform/common/Message;->m_strMessage:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->EncodeProtocolString(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/StringBuffer;)Ljava/lang/StringBuffer;

    .line 79
    const/16 v1, 0x22

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 81
    :cond_1
    return-void

    .line 71
    .end local v0           #fAppend:Z
    :cond_2
    const/4 v1, 0x0

    move v0, v1

    goto :goto_0
.end method
